package com.supervision.manage.service

import com.fly.base.core.Core
import com.supervision.domain.enums.UserEnum
import org.springframework.stereotype.Service

@Service
class IndexService {

    fun dashboardIndex(): HashMap<String, Any> {

        // 用户人数
        val userCount = Core.Q().queryForInt("""
            select count(*) from user where weight >= 0 and type = ?
        """.trimIndent(), UserEnum.TYPE_USER)

        val caseCount = Core.Q().queryForInt("""
            select count(*) from case_enforce where weight >= 0
        """.trimIndent())

        return hashMapOf<String, Any>(
                "userCount" to userCount,
                "caseCount" to caseCount
        )
    }


}